<?
//引入所有子系统信息
include_once("../../../common/model/extender_import.php");


include_once("../model/setting.php");


$type = $_REQUEST['type'];
$nid = $_REQUEST['nid'];

//获取单条数据，这个应该可以卸载model中
$data=select_one_line_all_items($table_prefix.'asset_data',"nid = '".$nid."'");


if($data){
    if($type == 'file'){
        $sql =   update_date($table_prefix.'asset_data',['ai_filename'=>''],'nid',$nid);

        $res =  mysql_query($sql);
    }
    elseif($type == 'icon'){
        $sql =   update_date($table_prefix.'asset_data',['ai_icon'=>''],'nid',$nid);

        $res =  mysql_query($sql);
    }


    if($res)
    {
        $result['error'] = "0";
    }
    else
    {
        $result['error'] = "1";
    }

    echo json_encode($result);
    exit;
}
?>